1. Field of the Invention
The invention relates to an image processing method and an image processing apparatus for making luminance correction on the basis of a histogram showing luminance of image data.
2. Related Background Art
Image data obtained by photographing an object by a digital camera, image data in which an image on a film of a silver salt photograph obtained by photographing an object is digitized by a film scanner, or the like is constructed by a plurality of pixels. Each pixel can be shown by, for example, a level of a luminance signal of 256 gradations in a range from 0 to 255. In the image data comprising the pixels, distribution of the luminance signal level is shown in the diagrams.
FIGS. 20 and 21 are luminance histograms of image data in which the luminance distribution is deviated to a low luminance side and a whole image is too dark. FIGS. 22 and 23 are luminance histograms of image data in which the luminance distribution is deviated to a high luminance side and a whole image is too bright. The image data of such luminance histograms causes a problem in which since the whole image is too dark or too bright, it is difficult to distinguish details of the object.
FIG. 24 shows a luminance histogram of image data in which although luminance is distributed as a whole, an intermediate area is small and which is obtained by photographing an object in a backlight situation or by photographing it at night by using a flash. The image data of such a luminance histogram causes a problem in which color expression is poor.
To solve the above problems, an image processing method is disclosed in JP-A-2000-134467. According to a conventional image processing method, an exposing state of image data is discriminated on the basis of the number of peak areas of a luminance histogram of the image data, an average value of luminance in the peak areas, or the like. For example, when there is one peak position and the average value of the luminance is larger than a predetermined reference value, it is determined to be over-exposure. When there are a plurality of peaks, the luminance average value is within a range of the predetermined reference value, and a difference between a highlight level and a shadow level is equal to or larger than a reference value, it is determined to be proper exposure. In other cases, it is determined to be the image data obtained, for example, by strobo-photographing an object in a backlight situation or at night. The image data is corrected in accordance with a result of each discrimination.
For example, when photographing a scenery in which the background is the sky, an object is a monochromatic building whose object is darker than the background, and its area ratio is equal to about ½, a histogram which is obtained when the exposure upon photographing is an under-exposure is as shown in FIG. 26 in which peak areas of luminance distribution exist at two positions on the low luminance side. A histogram which is obtained when the exposure upon photographing is an over-exposure is as shown in FIG. 27 in which peak areas of luminance distribution exist at two positions on the high luminance side.
According to the conventional image processing method, when there are a plurality of peak areas, it is determined to be the backlight or standard exposure. Therefore, luminance of the image of the under-exposure in which the peak areas exist at two positions or the image of the over-exposure in which the peak areas exist at two positions cannot be accurately corrected.